package com.PuzGame.combinenumbers;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Date;

import com.PuzGame.combinenumbers.Level.LevelStatus;

import android.content.Context;

public class ChallengerLevel extends Level
{
	private Date DateOfCreation;
	private BigInteger ChallengerId;
	private BigInteger ChallengeeId;
	protected int TimeinSec;
	
	
	

	

	public ChallengerLevel(BigInteger challengerId, BigInteger challengeeId, int level) {
		super(level);
		Type = LevelType.CHALLENGER;
		DateOfCreation = new Date();
		ChallengerId = challengerId;
		ChallengeeId = challengeeId;
		TimeinSec = -3;
	}
	
	public ChallengerLevel(BigInteger challengerId, BigInteger challengeeId, int level,long goal,ArrayList<Long> listOfNumbers, String sol, Context c) {
		super(level, goal, listOfNumbers,  sol,  c);
		Type = LevelType.CHALLENGER;
		DateOfCreation = new Date();
		ChallengerId = challengerId;
		ChallengeeId = challengeeId;
		TimeinSec = -3;
	}
  
	public ChallengerLevel(ChallengerLevel restoredLevel, Context c) {
		super(restoredLevel.getStage(), restoredLevel.getGoal(),restoredLevel.getListOfNumbers(),restoredLevel.getSolution(), c);
		Type = LevelType.CHALLENGER;
		ChallengerId = restoredLevel.getChallengerId();
		ChallengeeId = restoredLevel.getChallengeeId();
		DateOfCreation = new Date();
		TimeinSec = -3;
	}
	
	
	public void setStatus(LevelStatus status) {
		
		switch (status)
		{
		case DONE_TIMEOUT:
			TimeinSec = -1;
			break;
		case DONE_GAVE_UP:
			TimeinSec = -2;
			break;
		case DONE_CLEARED:
			
			break;
		default:
			TimeinSec = -3;
			break;
		}
		
		super.setStatus(status);
		StoreLevel(context,"ChallengeInfo");
	}
	
	public Date getDateOfCreation() {
		// TODO Auto-generated method stub
		return DateOfCreation;
	}
	
	public void setTimeinSec(int timeinSec) {
		TimeinSec = timeinSec;
	}
	
	public int getTimeinSec() {
		return TimeinSec;
	}

	public BigInteger getChallengeeId() {
		return ChallengeeId;
	}

	public void setChallengeeId(BigInteger challengeeId) {
		ChallengeeId = challengeeId;
	}

	public BigInteger getChallengerId() {
		return ChallengerId;
	}

	public void setChallengerId(BigInteger challengerId) {
		ChallengerId = challengerId;
	}
	
	


	
	
	

	
}
